<template>
  <div>
    <RegistrationInfoCollect
      :registrationInfo="registrationInfo"
      @success="queryRegisterDetail"
    ></RegistrationInfoCollect>
    <RegistrationInfo :registrationInfo="registrationInfo" @success="queryRegisterDetail"></RegistrationInfo>
    <AttendeesUserInfo :registrationInfo="registrationInfo" @success="queryRegisterDetail"></AttendeesUserInfo>
    <BuyTicketInfo v-if="registrationInfo.ticketType==TicketTypeEnum.pay" :registrationInfo="registrationInfo"></BuyTicketInfo>
  </div>
</template>

<script>
import AttendeesUserInfo from './AttendeesUserInfo.vue'
import BuyTicketInfo from './BuyTicketInfo.vue'
import RegistrationInfo from './RegistrationInfo.vue'
import RegistrationInfoCollect from './RegistrationInfoCollect.vue'
import { getRegisterDetail } from '@/api/activity/activity'
import { TicketTypeEnum } from "@/enums/activity.js";
export default {
  components: {
    AttendeesUserInfo,
    BuyTicketInfo,
    RegistrationInfo,
    RegistrationInfoCollect
  },
  data() {
    return {
      TicketTypeEnum,
      registrationInfo: {}
    }
  },
  mounted() {
    this.queryRegisterDetail()
  },

  methods: {
    async queryRegisterDetail() {
      const res = await getRegisterDetail(this.$route.query.id)
      if (res.code === 0) {
        this.registrationInfo = res.data
      }
    }
  }
}
</script>
